package com.hk.yingmi;

import com.hk.base.ResponseBase;
import com.hk.commons.JsonUtils;
import com.hk.service.yingmi.IYingmiResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 通过code返回codeMsg
 */
@Controller
public class ResultCodeCtrl {

	@Autowired
	private IYingmiResultCode iYingmiResultCode;

	@ResponseBody
	@RequestMapping(value = "/resultCode", method = RequestMethod.POST)
	public ResponseBase resultCode(@RequestParam String code) {
		ResponseBase rb = new ResponseBase();
		String codeMsg = iYingmiResultCode.getCodeMsg(code);
		rb.setResult(JsonUtils.toJson(codeMsg));
		return rb;
	}
}
